#include<stdio.h>
int main()
{
    int n,m;
    while(scanf("%d%d",&n,&m)!=EOF)
    {
    int i,j,sum=0,cnt=0;
    for(i=n;i<=m;i++)
    {
        sum=sum+i;
        cnt++;
        if(cnt==6)
        {
            cnt=1;
            printf("\n");
        }
        printf("%5d",i);
    }
    printf("\n");
    printf("Sum = %d\n",sum);
    }
    return 0;
}